let app = getApp();
Component({
  properties: {
    curr: {
      type: Number,
      value: 0,
    },
    toView: {
      type: String,
      value: '',
    },
    startYear: {
      type: String,
      value: String(new Date().getFullYear() - 1),
    },
    endYear: {
      type: String,
      value: String(new Date().getFullYear() + 1),
    },
    chosenYear: {
      type: String,
      value: String(new Date().getFullYear()),
    },
  },
  data: {
  },
  methods: {
    chooseCateType(e) {
      let dataset = e.currentTarget.dataset;
      let obj = {
        typetwoid: dataset.typetwoid,
        opt: dataset.opt,
      };
      this.triggerEvent('choose', obj);
    },
    bindYearChange(e) {
      let chosenYear = e.detail.value;
      this.setData({
        chosenYear: chosenYear,
      });
      this.triggerEvent('chosenYear', chosenYear);
    },
  },
});
